<?php

namespace maotool\core\response;

class PageResult extends Result
{

    protected $result = [];

    public function __construct($list = null)
    {
        $this->result['list'] = $list;
    }

    /**
     * @return int
     */
    public function getTotal()
    {
        return $this->result['total'];
    }

    /**
     * @param int $total
     */
    public function setTotal($total)
    {
        $this->result['total'] = $total;
    }

    /**
     * @return mixed|null
     */
    public function getList()
    {
        return $this->result['list'];
    }

    /**
     * @param mixed|null $list
     */
    public function setList($list)
    {
        $this->result['list'] = $list;
        $this->result['size'] = count($this->result['list']);
    }

    /**
     * @param mixed $pageNum
     */
    public function setPageNum($pageNum)
    {
        $this->result['pageNum'] = $pageNum;
    }

    /**
     * @return mixed
     */
    public function getPageSize()
    {
        return $this->result['pageSize'];
    }

    /**
     * @param mixed $pageSize
     */
    public function setPageSize($pageSize)
    {
        $this->result['pageSize'] = $pageSize;
    }

    /**
     * @return mixed
     */
    public function getPageNum()
    {
        return $this->result['pageNum'];
    }

    /**
     * @return mixed
     */
    public function getSize()
    {
        return $this->result['size'];
    }

    /**
     * @param mixed $size
     */
    public function setSize($size)
    {
        $this->result['size'] = $size;
    }

    /**
     * @return mixed
     */
    public function getPages()
    {
        return $this->result['pages'];
    }

    /**
     * @param mixed $pages
     */
    public function setPages($pages)
    {
        $this->result['pages'] = $pages;
    }

    /**
     * @return mixed
     */
    public function getStartRow()
    {
        return $this->result['startRow'];
    }

    /**
     * @param mixed $startRow
     */
    public function setStartRow($startRow)
    {
        $this->result['startRow'] = $startRow;
    }

    /**
     * @return mixed
     */
    public function getEndRow()
    {
        return $this->result['endRow'];
    }

    /**
     * @param mixed $endRow
     */
    public function setEndRow($endRow)
    {
        $this->result['endRow'] = $endRow;
    }

    /**
     * @return mixed
     */
    public function getPrePage()
    {
        return $this->result['prePage'];
    }

    /**
     * @param mixed $prePage
     */
    public function setPrePage($prePage)
    {
        $this->result['prePage'] = $prePage;
    }

    /**
     * @return mixed
     */
    public function getNextPage()
    {
        return $this->result['nextPage'];
    }

    /**
     * @param mixed $nextPage
     */
    public function setNextPage($nextPage)
    {
        $this->result['nextPage'] = $nextPage;
    }

    /**
     * @return mixed
     */
    public function getIsFirstPage()
    {
        return $this->result['isFirstPage'];
    }

    /**
     * @param mixed $isFirstPage
     */
    public function setIsFirstPage($isFirstPage)
    {
        $this->result['isFirstPage'] = $isFirstPage;
    }

    /**
     * @return mixed
     */
    public function getIsLastPage()
    {
        return $this->result['isLastPage'];
    }

    /**
     * @param mixed $isLastPage
     */
    public function setIsLastPage($isLastPage)
    {
        $this->result['isLastPage'] = $isLastPage;
    }

    /**
     * @return mixed
     */
    public function getHasPreviousPage()
    {
        return $this->result['hasPreviousPage'];
    }

    /**
     * @param mixed $hasPreviousPage
     */
    public function setHasPreviousPage($hasPreviousPage)
    {
        $this->result['hasPreviousPage'] = $hasPreviousPage;
    }

    /**
     * @return mixed
     */
    public function getHasNextPage()
    {
        return $this->result['hasNextPage'];
    }

    /**
     * @param mixed $hasNextPage
     */
    public function setHasNextPage($hasNextPage)
    {
        $this->result['hasNextPage'] = $hasNextPage;
    }

    /**
     * @return mixed
     */
    public function getPageNo()
    {
        return $this->result['pageNo'];
    }

    /**
     * @param mixed $pageNo
     */
    public function setPageNo($pageNo)
    {
        $this->result['pageNo'] = $pageNo;
    }

    /**
     * @return bool
     */
    public function isHasNextPage()
    {
        return $this->result['isHasNextPage'];
    }

    /**
     * @param bool $isHasNextPage
     */
    public function setIsHasNextPage($isHasNextPage)
    {
        $this->result['isHasNextPage'] = $isHasNextPage;
    }
    
    /**
     * @return mixed
     */
    public function getResult()
    {
        return $this->result;
    }
    
    /**
     * @param mixed $result
     */
    public function setResult($result)
    {
        $this->result = $result;
    }

}